<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    
</body>.
</html>
<script>
    //if分支语句
    var age = 17
    if(age >= 18){
        console.log("成年");
    }else{
        console.log("未成年");
    }
    var scor = prompt("请输入你的成绩")
    if (scor<=100 && scor >=90){
        console.log("优秀");
    }else if (scor<90 && scor >= 80){
        console.log("良好");
    }else if (scor<80 && scor >= 60){
        console.log("及格");
    }else if (scor<60){
        console.log("不及格");
    }else{
        console.log("你输入的成绩有误");
    }
    //闰年
    var year = 2022;
if((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0)) {
    console.log(year + '是闰年');
}else{
    console.log("不是闰年");
}



var one = prompt("请输入数字")
var two = prompt("请输入一个字符")
var three = prompt("请输入数字")
var sum;
if(two == '+'){
    sum = Number(one) + Number(three)
}else if(two  == '-'){
sum = Number(one) - Number(three)
}else if(two  == '*'){
sum = Number(one) * Number(three)
}else if(two  == '/'){
sum = Number(one) / Number(three)
}
alert(sum)



</script>